package com.cn.service.UserService;

import com.cn.Mapper.userMapper.UserMapper;
import com.cn.util.SqlsesstionUtil;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

/**
 * @ClassName loginService
 * @Description TODO
 * @Author yujiajing
 * @Date 2022/10/2 19:22
 * @Version 1.0
 */

@Service("loginService")
public class LoginService {
    public boolean login(String username,String password){
        SqlSession sqlSession = SqlsesstionUtil.getSqlSession();
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        if(userMapper.checkLogin(username,password )!=null){
            return true;
        }
        else {
            return false;
        }
    }
}

